package com.shzq.controller;

import com.shzq.service.PointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/point")
public class PointController {

    @Autowired
    private PointService pointService;

    @RequestMapping("/getAll")
    public Map<String,List<List<Double>>> getAllPoint(){
        return pointService.getAllPoint();
    }
    @RequestMapping("/getAllByStrength")
    public Map<String,List<List<Double>>> getAllPointByStrength(){
        return pointService.getAllPointOrderByStrength();
    }

    /**
     * 根据地震等级查询
     * @param grade
     * @return
     */
    @RequestMapping("/getByStrength/{grade}")
    public List<List<Double>>getPointByStrength(@PathVariable("grade") String grade){
        return pointService.getPointByStrength(grade);
    }

    /**
     * 根据震源深度查询
     * @param grade
     * @return
     */
    @RequestMapping("/getByDepth/{grade}")
    public List<List<Double>>getPointByDepth(@PathVariable("grade") String grade){
        return pointService.getPointByDepth(grade);
    }
}
